//
//  PeopleListModel.m
//  Utils
//
//  Created by enghou on 2018/4/21.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

#import "PeopleListModel.h"

@implementation PeopleListModel
-(instancetype)initWithSource:(NSDictionary *)source{
    self = [super initWithSource:source];
    if (self) {
        self.name = [self contentForKey:@"typeCname" withSource:source];
        self.tid = [self contentForKey:@"typeKeyName" withSource:source];
        NSArray *schoolings = [source objectForKey:@"subTypes"];
        NSMutableArray *array = [NSMutableArray array];
        for (NSDictionary *element in schoolings) {
            SubTypeItemModel *model = [[SubTypeItemModel alloc]init];
            model.name = element[@"subTypeCname"];
            model.subTid = [self contentForKey:@"subTypeKeyName" withSource:element];
            [array addObject:model];
        }
        self.children = [array copy];
    }
    return self;
}
@end
